<?php

interface Model_AuthService 
{
	/**
     * Perform User Authentication
     * 
     * @param String $username
     * @param String $password
     * @return boolean true on success, false otherwise
     */
	public function authenticate($username, $password);
	
	/**
     * Perform User Authentication using openID protocol
     * Retrieve also the user profile if it is available
     * 
     * @param String $username The openID user identifier
     * @param String $returnTo The url openid provider return to after authentication
     * @return boolean true on success, false otherwise
     */
    public function openIDAuth($username, $returnTo = null);
    
    /**
     * Get OpenID user profile if it is present and the user is logged in
     * 
     * @return array
     */
    public function getOpenIDProfile();
    
    /**
     * Perform user logout
     * 
     * @return void
     */    
    public function logout();
}
